package com.example.module_message.http

import com.example.lib_net.BaseResponse
import com.example.module_parking.model.AddParkingInfo
import com.example.module_parking.model.ParkingEntity
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path

interface ParkingApi {
    //"http://10.161.9.80:2209/api/parking-spaces/type/"
    @GET("/api/parking-spaces/type/{spaceType}")
    suspend fun getMessageList(@Path("spaceType")spaceType:String): BaseResponse<List<ParkingEntity>>
    /*
    添加车位
     */
    ///api/parking-spaces
    @POST("/api/parking-spaces")
    suspend fun addParking(@Body addParkingInfo: AddParkingInfo):BaseResponse<AddParkingInfo>

    /*
    编辑车位
     */
    @PUT("/api/parking-spaces/{id}")
    suspend fun editParking(@Path("id")id:Int,@Body addParkingInfo: AddParkingInfo):BaseResponse<AddParkingInfo>

    /*
    根据车辆id获得车辆信息，搜索
     */
    @GET("/api/parking-spaces/{id}")
    suspend fun searchParking(@Path("id")id:Int):BaseResponse<ParkingEntity>
}